Skip to content

feat: add product flavor and dimension to RN App#386

Open
hurali97 wants to merge 8 commits into
mainfrom
feat/add-flavor-dimensions
Open

feat: add product flavor and dimension to RN App#386
hurali97 wants to merge 8 commits into
mainfrom
feat/add-flavor-dimensions

Conversation

@hurali97

Copy link
Copy Markdown
Member

Summary

This PR adds product flavor and dimension to RN App. This helps increase the coverage for BGP to catch any regressions around product flavors and dimensions. For instance, after making these changes we found that the JNI libs were not being included in the AAR because of hardcoded sourcesets configuration.

Test plan

  • Verified locally
  • CI passes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an env flavor dimension (dev/prod) to the example React Native app and Brownfield library, and updates the brownfield Gradle plugin source-set wiring so variant-specific JNI libs and generated assets/resources are included correctly for flavored builds.

Changes:

  • Add env flavor dimension + dev/prod flavors to apps/RNApp (:app and :BrownfieldLib).
  • Update the brownfield Gradle plugin source-set configuration to include per-variant JNI lib directories (e.g., libsDevRelease).
  • Ensure the Android example app can consume the new flavored library via missingDimensionStrategy("env", "dev"), and adjust packaging script / gitignore patterns accordingly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
gradle-plugins/react/README.md Documents how to use product flavors/dimensions with the brownfield module and the required alignment with the RN :app module.
gradle-plugins/react/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/RNSourceSets.kt Switches JNI lib source-set wiring from build-type-only to per-variant directories to support flavored variants.
apps/RNApp/package.json Updates the Android packaging script to package the devRelease variant.
apps/RNApp/android/BrownfieldLib/build.gradle.kts Adds env flavor dimension and dev/prod flavors to the Brownfield library module.
apps/RNApp/android/app/build.gradle Adds matching env flavor dimension and dev/prod flavors to the RN app module.
apps/RNApp/.gitignore Generalizes ignores to cover flavored JNI lib output directories (libs*Debug, libs*Release).
apps/AndroidApp/app/build.gradle.kts Adds missingDimensionStrategy("env", "dev") so the consumer app can resolve the new env dimension.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/RNApp/android/BrownfieldLib/build.gradle.kts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants